//
// ftManager.h
//
#pragma once

// call back for update the manager status
typedef void (*lpcbFTManagerStatus)(DWORD, DWORD, DWORD, PVOID);

class ftNode;
// name: ftManager
// type: Maintenance
// file tree manager, for maintain the tree struct
class ftManager
{
public:
	ftManager(void);
	~ftManager(void);

	BOOL CreateTree(CString, lpcbFTManagerStatus pCallbackFun = NULL, LPVOID lParam = NULL);
	void CleanTree();
	BOOL IsTraversing();
	//
	UINT GetTreeLevel();
	void GetTreeSize(LARGE_INTEGER&);
	//
	void FindNode();
	void AddNode();
	void DelNode();
	
	void UpdateNode();

	ftNode* m_pRootNode;

private:
	//add "*" for rootpath, like "c:\" to "c:\*"
	CString RemoveBackSlash(CString&);
	CString GetFullPath(ftNode*);
	BOOL IsDot(CString);
	void CountChild(ftNode*);

	UINT m_nPercent;
	
	BOOL m_bTraversing;
};
